<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title></title>
</head>
<body>
<form id="role_edit_form" method="post"
      action="${pageContext.request.contextPath}/admin/role/update.html">
  <input name="id" type="hidden" value="${requestScope.data.id}" />
  <div style="width: 350px;margin: 15px;">
        <span class="block input-icon input-icon-right">
        <input type="text" class="form-control" maxlength="50" value="${requestScope.data.name}"
               placeholder="角色名 "
               name="name"
               datatype="rolename"
               nullmsg="角色名不能为空"
               errormsg="角色名格式错误" />
        </span>
    <p class="form_prompt">角色名由英文字母和数字组成</p>
        <span class="block input-icon input-icon-right">
        <input type="text" class="form-control" maxlength="100" value="${requestScope.data.description}"
               placeholder="角色描述 "
               name="desc"
               datatype="*"
               nullmsg="角色描述不能为空"
               errormsg="角色描述格式错误">
        </span>
    <p class="form_prompt">角色描述不能超过100个字符</p>
    <div>
      <button type="submit" class="btn btn-sm btn-primary"><i class="icon-save align-top bigger-125"></i>保存</button>
      <a href="${pageContext.request.contextPath}/admin/role/manage.html" class="btn btn-sm btn-grey"><i class="icon-reply align-top bigger-125"></i>返回</a>
    </div>
  </div>
</form>
<script>
  top.setMenuActionOpen('系统设置','角色管理','编辑角色');
  $('#role_edit_form').Validform({
    btnSubmit: "#role_edit_form button[type=submit]",
    showAllError: false,
    postonce: true,
    ajaxPost: false,
    tiptype: function (msg, o, cssctl) {
      if (!o.obj.is("form")) {
        var objtip = o.obj.parent().next(".form_prompt");
        cssctl(objtip, o.type);
        objtip.text(msg);
      }
    },
    beforeSubmit: function (curform) {
      return true;
    }
  });
</script>
</body>
</html>
